package com.andy.beef.app.activity

import androidx.lifecycle.MutableLiveData
import com.andy.beef.ui.main.api.tradeService
import com.andy.module.BASE_FC_BEE
import com.andy.module.bean.AppUpdateBean
import com.andy.network.base.BaseViewModel
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

/**
 * @creator:LuoFan
 * @date:2022/5/25
 * @description:
 */
class SplashViewModel : BaseViewModel() {

    private val updateUrl = BASE_FC_BEE + "mobile/app-version/get"

    //02是大农科技业务端的id
    private val appId = "102"

    var updateInfoResult = MutableLiveData<ResultState<AppUpdateBean>>()

    fun getVersion() {
        val params = HashMap<String, Any>()
        params["appId"] = appId
        request(
            { tradeService.getVersionInfo(updateUrl, params) },
            updateInfoResult,
            false,
            ""
        )
    }

}